{% macro artist(A) -%}
    <span>{% if A.home_country %}
     {{ dv.flag(A.home_country) }}
    {% else %}
     <img src="/static/user_green.png" />
    {% endif %}
    <a href="{{ A.get_absolute_url() }}" 
     {% if A.alias_of %}
       title="Alias of {{A.alias_of|e}}"
     {% else %}
       {% if A.aliases.all() %}
         title="Aliases : {% for alias in A.aliases.all() %}{{ alias.handle|e }} {% endfor %}"
       {% endif %}
     {% endif %}>
     {{ A.handle|e }}
     {% if A.name %} ({{ A.name|e }}){% endif %}
     </a>
     {% if A.is_deceased %}
        <img src="/static/deceased.png" class="countryflag" title="Deceased {% if A.deceased_date %}[On {{ A.deceased_date }}]{% endif %}" />
     {% endif %}
    </span>
{% endmacro %}

{% macro compilation(C) -%}
    <img class="compilation_icon" {% if C.comp_icon %}src="{{ C.comp_icon.url }}"{% else %}src="/static/recplay_ico.png"{% endif %} /><a href="{{ C.get_absolute_url() }}">{{ C.name|e }}</a>
{%- endmacro %}

{% macro user(U) -%}
    <span>{{ dv.flag(U.get_profile().country) }}<a href="/demovibes/user/{{ U.username|e }}/" title="{{ U.get_profile().get_stat() }}" >{{ U.username|e }}</a></span>
{%- endmacro %}

{% macro label(L) -%}
    <img class="label_icon" {% if L.label_icon %}src="{{ L.label_icon.url }}"{% else %}src="/static/transmit_blue.png"{% endif %} /><a href="{{ L.get_absolute_url }}">{{ L.name|e }}</a>
{%- endmacro %}

{% macro group(G) -%}
    <img class="group_icon" {% if G.group_icon %}src="{{ G.group_icon.url }}"{% else %}src="/static/group.png"{% endif %} /><a href="{{ G.get_absolute_url }}">{{ G.name|e }}</a>
{% endmacro %}

{% macro platform(P) -%}
    {% if P.symbol -%}
        <a href="{{ P.get_absolute_url() }}"><img src="{{ P.symbol.url }}" title="{{ P.title|e }}" /></a>
    {%- endif -%}
    <a href="{{ P.get_absolute_url() }}">{{P.title|e}}</a>
{%- endmacro %}

{% macro songicons(S) -%}
    {% if S.pouetid %}<a href="http://www.pouet.net/prod.php?which={{S.pouetid}}" target="_new"><img class="song-resource" src="/static/pouet-icon.gif" title="[Pouet Link]" /></a>{% endif %}
    {% if S.dtv_id %} <a href="http://www.demoscene.tv/prod.php?id_prod={{ S.dtv_id }}" target="_new"><img class="song-resource" src="/static/television.png" title="[Demoscene.TV Link]" /></a>{% endif %}
    {% if S.hol_id %} <a href="http://hol.abime.net/{{ S.hol_id }}" target="_new"><img class="song-resource" src="/static/hol-icon.png" title="[Hall Of Light Link]" /></a>{% endif %}
    {% if S.al_id %} <a href="http://www.atarilegend.com/games/games_detail.php?game_id={{ S.al_id }}" target="_new"><img class="song-resource" src="/static/atari-icon.png" title="[Atari Legends Link]" /></a>{% endif %}
    {% if S.wos_id %} <a href="http://www.worldofspectrum.org/infoseekid.cgi?id={{S.wos_id}}" target="_new"><img class="song-resource" src="/static/wos-icon.png" title="[World of Spectrum Link]" /></a>{% endif %}
    {% if S.zxdemo_id %} <a href="http://zxdemo.org/item.php?id={{S.zxdemo_id}}" target="_new"><img class="song-resource" src="/static/zxdemo-icon.gif" title="[ZXDemo Link]" /></a>{% endif %}
    {% if S.lemon_id %} <a href="http://www.lemon64.com/games/details.php?ID={{S.lemon_id}}" target="_new"><img class="song-resource" src="/static/lemon64-icon.gif" title="[Lemon64 Link]" /></a>{% endif %}
    {% if S.projecttwosix_id %} <a href="http://project2612.org/details.php?id={{S.projecttwosix_id}}" target="_new"><img class="song-resource" src="/static/project2612-icon.png" title="[Project2612 Link]" /></a>{% endif %}
    {% if S.hvsc_url %} <a href="{{ S.hvsc_url }}"><img class="song-resource" src="/static/sid-icon.gif" title="[SID File]" /></a>{% endif %}
{%- endmacro %}

{% macro song(song) -%}
    {%- if song.platform.symbol -%}
        <a href="{{ song.platform.get_absolute_url() }}"><img class="platform_icon" src="{{ song.platform.symbol.url }}" title="{{ song.platform.title|e }}" /></a>
    {%- endif -%}
    <a href="{{ song.get_absolute_url() }}">{{ song.title|e }}</a>
    {%- if song.explicit -%}
        <img class="text-link" src="/static/explicit.gif" title="Contains Explicit Content!" />
    {%- endif -%}
{%- endmacro %}
